using Hyjx.MixerReportService;
using MixerReport.Common;
using System.Diagnostics;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddWindowsService();
builder.Services.AddHostedService<ReportService>();
builder.Services.AddLogging(options =>
{
    options.ClearProviders();
    options.AddConsole();
    options.AddEventLog(options=>
    {
        options.LogName = MixerReportConstants.EventLogName;
        options.SourceName = MixerReportConstants.EvenetLogSourceName;
    });
});
if (!EventLog.Exists(MixerReportConstants.EventLogName) || !EventLog.SourceExists(MixerReportConstants.EvenetLogSourceName))
    EventLog.CreateEventSource(MixerReportConstants.EvenetLogSourceName, MixerReportConstants.EventLogName);

var host = builder.Build();

host.Run();